Trò chơi đua xe động vật trong UNITY Engine
114.935 lượt xem;
- FontLevel.cs
- LevelScreen /
- AnimalRacing /
- Scripts /
- Assets /
- project /
1 using UnityEngine;
2 using System.Collections;
3
4 public class FontLevel : MonoBehaviour {
5 private BoardLevel boardLevel;
6
7 private BitmapFont levelFont;
8
9 public Sprite starSprite;
10 public GameObject bgObject;
11 public ThreeStar threeStars;
12
13
14 public void setStar(int star, bool isActive)
15 {
16 threeStars.setSprite(star, starSprite, isActive);
17 }
18
19 public void setBoardLevel(BoardLevel boardLevel)
20 {
21 this.boardLevel = boardLevel;
22 levelFont = new BitmapFont(boardLevel.getFont(), gameObject);
23 }
24
25 public void setText(string text)
26 {
27 levelFont.setText(text, 0, 0);
28 }
29 }
2 using System.Collections;
3
4 public class FontLevel : MonoBehaviour {
5 private BoardLevel boardLevel;
6
7 private BitmapFont levelFont;
8
9 public Sprite starSprite;
10 public GameObject bgObject;
11 public ThreeStar threeStars;
12
13
14 public void setStar(int star, bool isActive)
15 {
16 threeStars.setSprite(star, starSprite, isActive);
17 }
18
19 public void setBoardLevel(BoardLevel boardLevel)
20 {
21 this.boardLevel = boardLevel;
22 levelFont = new BitmapFont(boardLevel.getFont(), gameObject);
23 }
24
25 public void setText(string text)
26 {
27 levelFont.setText(text, 0, 0);
28 }
29 }